package bubblechart.server;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

public class Main {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		Server server = new Server(8083);
        
        ServletContextHandler servletContextHandler = new ServletContextHandler(server, "/", true, false);
        servletContextHandler.addServlet(BallsServlet.class, "/balls");
        
        ServletHolder holderJs = new ServletHolder(DefaultServlet.class);
        holderJs.setInitParameter("resourceBase", "static");
        servletContextHandler.addServlet(holderJs, "/js/*");
        
        ServletHolder holderCss = new ServletHolder(DefaultServlet.class);
        holderCss.setInitParameter("resourceBase", "static");
        servletContextHandler.addServlet(holderCss, "/css/*");


        server.start();
		server.join();
	}

}
